package bungaeting.net.client.android.request;

import java.util.Map;

import android.util.Log;


abstract public class Requestor {
	abstract public Response doRequest(Request request);
	protected Response createResponse(Request request, Map<String, Object> mapResponse){
		if (mapResponse.get("params") instanceof String){
			Log.d("TEST", "params string [" + (String)mapResponse.get("params") + "]");
		}
		@SuppressWarnings("unchecked")
		Map<String, Object> params = (Map<String, Object>)mapResponse.get("params");
		String returnCode = (String)mapResponse.get("returnCode");
		String returnMsg = (String)mapResponse.get("returnMsg");
		return new Response(request.getServiceId(), request.getRequestId(), params, returnCode, returnMsg);
	}
}
